package com.shu.zk;

import java.util.Arrays;

/**
 * @author ssm
 * @version V1.0
 * @description:
 * @date 2020/6/12 18:38
 */

public class Test {
    public static void main(String[] args) {
        String x = "CMCC-31628-38D2CA8F38BC\n" +
                "CMCC-31628-38D2CA8F577B\n" +
                "CMCC-500566-38D2CAD5442B\n" +
                "CMCC-500566-38D2CAD5F459\n" +
                "CMCC-500566-38D2CAD6164F\n" +
                "CMCC-500801-F8A763E40F2E";
        Arrays.stream(x.split("\n")).forEach(s->{
            String substring = s.substring(s.length() - 12, s.length());

            String s1 = substring.substring(0, 2).concat(":") +
                    substring.substring(2, 4).concat(":") +
                    substring.substring(4, 6).concat(":") +
                    substring.substring(6, 8).concat(":") +
                    substring.substring(8, 10).concat(":") +
                    substring.substring(10, 12);
            System.out.println(s1);
        });
    }
}
